package com.gagakuai.bpm.demo.messageEvent.customer;

import lombok.extern.slf4j.Slf4j;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;

/*
 * @program: bpm_server
 * @description: 客户发起订单
 * @author: houhong
 * @create: 2022-07-21 22:01
 */
@Slf4j
@Component(value = "customerOderDelagte")
public class CustomerOderDelagte implements JavaDelegate {


    @Override
    public void execute(DelegateExecution execution) throws Exception {


        RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService();

        //客户发起订单
        runtimeService.startProcessInstanceByMessage("Message_order");

    }
}